<!--
 * @Descripttion: 学生查询成绩列表
 * @version: 
 * @Author: hzx
 * @Date: 2021-03-26 21:19:15
 * @LastEditors: hzx
 * @LastEditTime: 2021-03-27 21:15:27
-->
<template>
    <h2>个人成绩</h2>
    <a-table
        :rowKey="(record) => record.stu_id"
        :columns="columns"
        :data-source="state.checkData"
        bordered
    ></a-table>
</template>

<script>
import { selStuView } from "@/api/course";
import { reactive, onMounted, defineComponent } from "vue";
import { useStore } from "vuex";
const columns = [
    {
        title: "班级",
        dataIndex: "class_name",
        key: "class",
    },
    {
        title: "姓名",
        dataIndex: "stu_name",
        key: "name",
    },
    {
        title: "科目",
        dataIndex: "course_name",
        key: "course_name",
        ellipsis: true,
    },
    {
        title: "授课老师",
        dataIndex: "t_name",
        key: "t_name",
        ellipsis: true,
    },
    {
        title: "成绩",
        dataIndex: "gende",
        key: "gende",
        ellipsis: true,
    },
];
export default defineComponent({
    setup() {
        let state = reactive({
            data: [],
        });

        const store = useStore();

        onMounted(async () => {
            //获取学生成绩视图
            state.checkData = await selStuView(store.state.resourceId.stu_id);
        });

        return {
            state,
            columns,
        };
    },
});
</script>

<style>
</style>